package com.dragon.modules.yuegou.query.product;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.product.GrouponEntity;
import com.dragon.modules.yuegou.enums.product.GrouponStatus;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 团购表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-10-08 14:15:24
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class GrouponQuery extends GrouponEntity implements Query<GrouponEntity> {

    /** 主键ID查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈ID查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 商户ID查询条件 */
	@JsonUnwrapped(prefix = "merchantId")
	private Condition<String> merchantIdCondition;

    /** 拼团活动信息ID查询条件 */
	@JsonUnwrapped(prefix = "grouponInfoId")
	private Condition<String> grouponInfoIdCondition;

    /** 拼团skuID查询条件 */
	@JsonUnwrapped(prefix = "skuId")
	private Condition<String> skuIdCondition;

    /** 购买时间查询条件 */
	@JsonUnwrapped(prefix = "buyTime")
	private Condition<LocalDateTime> buyTimeCondition;

    /** [枚举]状态：0-未成团-NO_SUCCESS、1-已成团-SUCCESS查询条件 */
	@JsonUnwrapped(prefix = "status")
	private Condition<GrouponStatus> statusCondition;

    /** 参团人数查询条件 */
	@JsonUnwrapped(prefix = "joinNum")
	private Condition<Integer> joinNumCondition;

    /** 发起人ID查询条件 */
	@JsonUnwrapped(prefix = "owner")
	private Condition<Long> ownerCondition;

    /** 发起时间查询条件 */
	@JsonUnwrapped(prefix = "createTime")
	private Condition<LocalDateTime> createTimeCondition;

    /** 是否过期:0:否 1:是查询条件 */
	@JsonUnwrapped(prefix = "isExpire")
	private Condition<Boolean> isExpireCondition;

    /** 是否单独购买 0否 1是查询条件 */
	@JsonUnwrapped(prefix = "isSingleBuy")
	private Condition<Boolean> isSingleBuyCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public GrouponQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public GrouponQuery(GrouponEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public GrouponQuery(GrouponQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.merchantIdCondition != null) {
			this.merchantIdCondition = other.merchantIdCondition.copy();
		}
		if(other.grouponInfoIdCondition != null) {
			this.grouponInfoIdCondition = other.grouponInfoIdCondition.copy();
		}
		if(other.skuIdCondition != null) {
			this.skuIdCondition = other.skuIdCondition.copy();
		}
		if(other.buyTimeCondition != null) {
			this.buyTimeCondition = other.buyTimeCondition.copy();
		}
		if(other.statusCondition != null) {
			this.statusCondition = other.statusCondition.copy();
		}
		if(other.joinNumCondition != null) {
			this.joinNumCondition = other.joinNumCondition.copy();
		}
		if(other.ownerCondition != null) {
			this.ownerCondition = other.ownerCondition.copy();
		}
		if(other.createTimeCondition != null) {
			this.createTimeCondition = other.createTimeCondition.copy();
		}
		if(other.isExpireCondition != null) {
			this.isExpireCondition = other.isExpireCondition.copy();
		}
		if(other.isSingleBuyCondition != null) {
			this.isSingleBuyCondition = other.isSingleBuyCondition.copy();
		}
	}

	@Override
	public QueryWrapper<GrouponEntity> toQueryWrapper() {
		QueryWrapper<GrouponEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (merchantIdCondition != null) {
			merchantIdCondition.toWrapper(wrapper, COL_MERCHANT_ID);
		}
		if (grouponInfoIdCondition != null) {
			grouponInfoIdCondition.toWrapper(wrapper, COL_GROUPON_INFO_ID);
		}
		if (skuIdCondition != null) {
			skuIdCondition.toWrapper(wrapper, COL_SKU_ID);
		}
		if (buyTimeCondition != null) {
			buyTimeCondition.toWrapper(wrapper, COL_BUY_TIME);
		}
		if (statusCondition != null) {
			statusCondition.toWrapper(wrapper, COL_STATUS);
		}
		if (joinNumCondition != null) {
			joinNumCondition.toWrapper(wrapper, COL_JOIN_NUM);
		}
		if (ownerCondition != null) {
			ownerCondition.toWrapper(wrapper, COL_OWNER);
		}
		if (createTimeCondition != null) {
			createTimeCondition.toWrapper(wrapper, COL_CREATE_TIME);
		}
		if (isExpireCondition != null) {
			isExpireCondition.toWrapper(wrapper, COL_IS_EXPIRE);
		}
		if (isSingleBuyCondition != null) {
			isSingleBuyCondition.toWrapper(wrapper, COL_IS_SINGLE_BUY);
		}
		return wrapper;
	}

	/**
	 * 构造并返回主键ID查询条件
	 * 
	 * @return idCondition 主键ID查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取主键ID查询条件
	 * 
	 * @return idCondition 主键ID查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置主键ID查询条件
	 * 
	 * @param idCondition 主键ID查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈ID查询条件
	 * 
	 * @param busdIdCondition 商圈ID查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> merchantId() {
		this.merchantIdCondition = new Condition<>();
		return this.merchantIdCondition;
	}
	
	/**
	 * 获取商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> getMerchantIdCondition() {
		return merchantIdCondition;
	}

	/**
	 * 设置商户ID查询条件
	 * 
	 * @param merchantIdCondition 商户ID查询条件
	 */
	public void setMerchantIdCondition(Condition<String> merchantIdCondition) {
		this.merchantIdCondition = merchantIdCondition;
	}

	/**
	 * 构造并返回拼团活动信息ID查询条件
	 * 
	 * @return grouponInfoIdCondition 拼团活动信息ID查询条件
	 */
	public Condition<String> grouponInfoId() {
		this.grouponInfoIdCondition = new Condition<>();
		return this.grouponInfoIdCondition;
	}
	
	/**
	 * 获取拼团活动信息ID查询条件
	 * 
	 * @return grouponInfoIdCondition 拼团活动信息ID查询条件
	 */
	public Condition<String> getGrouponInfoIdCondition() {
		return grouponInfoIdCondition;
	}

	/**
	 * 设置拼团活动信息ID查询条件
	 * 
	 * @param grouponInfoIdCondition 拼团活动信息ID查询条件
	 */
	public void setGrouponInfoIdCondition(Condition<String> grouponInfoIdCondition) {
		this.grouponInfoIdCondition = grouponInfoIdCondition;
	}

	/**
	 * 构造并返回拼团skuID查询条件
	 * 
	 * @return skuIdCondition 拼团skuID查询条件
	 */
	public Condition<String> skuId() {
		this.skuIdCondition = new Condition<>();
		return this.skuIdCondition;
	}
	
	/**
	 * 获取拼团skuID查询条件
	 * 
	 * @return skuIdCondition 拼团skuID查询条件
	 */
	public Condition<String> getSkuIdCondition() {
		return skuIdCondition;
	}

	/**
	 * 设置拼团skuID查询条件
	 * 
	 * @param skuIdCondition 拼团skuID查询条件
	 */
	public void setSkuIdCondition(Condition<String> skuIdCondition) {
		this.skuIdCondition = skuIdCondition;
	}

	/**
	 * 构造并返回购买时间查询条件
	 * 
	 * @return buyTimeCondition 购买时间查询条件
	 */
	public Condition<LocalDateTime> buyTime() {
		this.buyTimeCondition = new Condition<>();
		return this.buyTimeCondition;
	}
	
	/**
	 * 获取购买时间查询条件
	 * 
	 * @return buyTimeCondition 购买时间查询条件
	 */
	public Condition<LocalDateTime> getBuyTimeCondition() {
		return buyTimeCondition;
	}

	/**
	 * 设置购买时间查询条件
	 * 
	 * @param buyTimeCondition 购买时间查询条件
	 */
	public void setBuyTimeCondition(Condition<LocalDateTime> buyTimeCondition) {
		this.buyTimeCondition = buyTimeCondition;
	}

	/**
	 * 构造并返回[枚举]状态：0-未成团-NO_SUCCESS、1-已成团-SUCCESS查询条件
	 * 
	 * @return statusCondition [枚举]状态：0-未成团-NO_SUCCESS、1-已成团-SUCCESS查询条件
	 */
	public Condition<GrouponStatus> status() {
		this.statusCondition = new Condition<>();
		return this.statusCondition;
	}
	
	/**
	 * 获取[枚举]状态：0-未成团-NO_SUCCESS、1-已成团-SUCCESS查询条件
	 * 
	 * @return statusCondition [枚举]状态：0-未成团-NO_SUCCESS、1-已成团-SUCCESS查询条件
	 */
	public Condition<GrouponStatus> getStatusCondition() {
		return statusCondition;
	}

	/**
	 * 设置[枚举]状态：0-未成团-NO_SUCCESS、1-已成团-SUCCESS查询条件
	 * 
	 * @param statusCondition [枚举]状态：0-未成团-NO_SUCCESS、1-已成团-SUCCESS查询条件
	 */
	public void setStatusCondition(Condition<GrouponStatus> statusCondition) {
		this.statusCondition = statusCondition;
	}

	/**
	 * 构造并返回参团人数查询条件
	 * 
	 * @return joinNumCondition 参团人数查询条件
	 */
	public Condition<Integer> joinNum() {
		this.joinNumCondition = new Condition<>();
		return this.joinNumCondition;
	}
	
	/**
	 * 获取参团人数查询条件
	 * 
	 * @return joinNumCondition 参团人数查询条件
	 */
	public Condition<Integer> getJoinNumCondition() {
		return joinNumCondition;
	}

	/**
	 * 设置参团人数查询条件
	 * 
	 * @param joinNumCondition 参团人数查询条件
	 */
	public void setJoinNumCondition(Condition<Integer> joinNumCondition) {
		this.joinNumCondition = joinNumCondition;
	}

	/**
	 * 构造并返回发起人ID查询条件
	 * 
	 * @return ownerCondition 发起人ID查询条件
	 */
	public Condition<Long> owner() {
		this.ownerCondition = new Condition<>();
		return this.ownerCondition;
	}
	
	/**
	 * 获取发起人ID查询条件
	 * 
	 * @return ownerCondition 发起人ID查询条件
	 */
	public Condition<Long> getOwnerCondition() {
		return ownerCondition;
	}

	/**
	 * 设置发起人ID查询条件
	 * 
	 * @param ownerCondition 发起人ID查询条件
	 */
	public void setOwnerCondition(Condition<Long> ownerCondition) {
		this.ownerCondition = ownerCondition;
	}

	/**
	 * 构造并返回发起时间查询条件
	 * 
	 * @return createTimeCondition 发起时间查询条件
	 */
	public Condition<LocalDateTime> createTime() {
		this.createTimeCondition = new Condition<>();
		return this.createTimeCondition;
	}
	
	/**
	 * 获取发起时间查询条件
	 * 
	 * @return createTimeCondition 发起时间查询条件
	 */
	public Condition<LocalDateTime> getCreateTimeCondition() {
		return createTimeCondition;
	}

	/**
	 * 设置发起时间查询条件
	 * 
	 * @param createTimeCondition 发起时间查询条件
	 */
	public void setCreateTimeCondition(Condition<LocalDateTime> createTimeCondition) {
		this.createTimeCondition = createTimeCondition;
	}

	/**
	 * 构造并返回是否过期:0:否 1:是查询条件
	 * 
	 * @return isExpireCondition 是否过期:0:否 1:是查询条件
	 */
	public Condition<Boolean> isExpire() {
		this.isExpireCondition = new Condition<>();
		return this.isExpireCondition;
	}
	
	/**
	 * 获取是否过期:0:否 1:是查询条件
	 * 
	 * @return isExpireCondition 是否过期:0:否 1:是查询条件
	 */
	public Condition<Boolean> getIsExpireCondition() {
		return isExpireCondition;
	}

	/**
	 * 设置是否过期:0:否 1:是查询条件
	 * 
	 * @param isExpireCondition 是否过期:0:否 1:是查询条件
	 */
	public void setIsExpireCondition(Condition<Boolean> isExpireCondition) {
		this.isExpireCondition = isExpireCondition;
	}

	/**
	 * 构造并返回是否单独购买 0否 1是查询条件
	 * 
	 * @return isSingleBuyCondition 是否单独购买 0否 1是查询条件
	 */
	public Condition<Boolean> isSingleBuy() {
		this.isSingleBuyCondition = new Condition<>();
		return this.isSingleBuyCondition;
	}
	
	/**
	 * 获取是否单独购买 0否 1是查询条件
	 * 
	 * @return isSingleBuyCondition 是否单独购买 0否 1是查询条件
	 */
	public Condition<Boolean> getIsSingleBuyCondition() {
		return isSingleBuyCondition;
	}

	/**
	 * 设置是否单独购买 0否 1是查询条件
	 * 
	 * @param isSingleBuyCondition 是否单独购买 0否 1是查询条件
	 */
	public void setIsSingleBuyCondition(Condition<Boolean> isSingleBuyCondition) {
		this.isSingleBuyCondition = isSingleBuyCondition;
	}

}
